<template>
    <div class="Count">
        <h2>当前求和为：{{ CountStore.sum }}</h2>
        <select v-model.number="n">
            <option value=1>1</option>
            <option value=2>2</option>
            <option value=3>3</option>
        </select>
        <button @click="CountStore.add(n)">加</button>
        <button @click="CountStore.minus(n)">减</button>
    </div>
</template>
<script lang="ts" setup name="Count">
import { reactive, ref, toRefs } from 'vue';
import useCountStore from '@/store/count';
    const CountStore=useCountStore();
    console.log(CountStore);
    let n= ref(0);

    
    
</script>
<style scoped>
   .Count{
    background-color: skyblue;
    padding: 10px;
    border-radius: 10px;
    box-sizing: 0 0 10px;
   } 
   select,button{
    margin: 0 5px;
    height: 25px;
   }
</style>
